"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandlerMgr = void 0;
const GameUtils_1 = __importDefault(require("./GameUtils"));
const SmallHandler_1 = require("./handler/SmallHandler");
const BigHandler_1 = require("./handler/BigHandler");
const __Handler_1 = require("./handler/\u5E7D\u7075Handler");
const __Handler_2 = require("./handler/\u70AE\u53F0Handler");
const __Handler_3 = require("./handler/\u6076\u7075Handler");
const __Handler_4 = require("./handler/\u72D9\u70AEHandler");
const __Handler_5 = require("./handler/\u987D\u77F3Handler");
const __Handler_6 = require("./handler/\u5730\u7075Handler");
const __Handler_7 = require("./handler/\u7CBE\u7075Handler");
const __Handler_8 = require("./handler/\u6C99\u5175Handler");
const __Handler_9 = require("./handler/\u6C99\u7687Handler");
const __Handler_10 = require("./handler/\u91CE\u732AHandler");
const __Handler_11 = require("./handler/\u91CE\u9A6CHandler");
const __Handler_12 = require("./handler/\u62F3\u5E08Handler");
const __Handler_13 = require("./handler/\u7075\u9635Handler");
const __Handler_14 = require("./handler/\u5929\u8C15Handler");
const __Handler_15 = require("./handler/\u5996\u672FHandler");
const __Handler_16 = require("./handler/\u9F13\u821EHandler");
/**
 * 对局对战类
 */
class HandlerMgr {
    constructor(gameMgr) {
        this.gameMgr = gameMgr;
        this.smallHandler = new SmallHandler_1.SmallHandler(gameMgr, this);
        this.bigHandler = new BigHandler_1.BigHandler(gameMgr, this);
        this.handler_幽灵 = new __Handler_1.幽灵Handler(gameMgr, this);
        this.handler_恶灵 = new __Handler_3.恶灵Handler(gameMgr, this);
        this.handler_炮台 = new __Handler_2.炮台Handler(gameMgr, this);
        this.handler_狙炮 = new __Handler_4.狙炮Handler(gameMgr, this);
        this.handler_顽石 = new __Handler_5.顽石Handler(gameMgr, this);
        this.handler_地灵 = new __Handler_6.地灵Handler(gameMgr, this);
        this.handler_精灵 = new __Handler_7.精灵Handler(gameMgr, this);
        this.handler_沙兵 = new __Handler_8.沙兵Handler(gameMgr, this);
        this.handler_沙皇 = new __Handler_9.沙皇Handler(gameMgr, this);
        this.handler_野猪 = new __Handler_10.野猪Handler(gameMgr, this);
        this.handler_野马 = new __Handler_11.野马Handler(gameMgr, this);
        this.handler_拳师 = new __Handler_12.拳师Handler(gameMgr, this);
        this.handler_灵阵 = new __Handler_13.灵阵Handler(gameMgr, this);
        this.handler_天谕 = new __Handler_14.天谕Handler(gameMgr, this);
        this.handler_妖术 = new __Handler_15.妖术Handler(gameMgr, this);
        this.handler_鼓舞 = new __Handler_16.鼓舞Handler(gameMgr, this);
    }
    gc() {
        this.gameMgr = null;
        this.smallHandler.gc();
        this.bigHandler.gc();
        this.handler_幽灵.gc();
        this.handler_恶灵.gc();
        this.handler_炮台.gc();
        this.handler_狙炮.gc();
        this.handler_顽石.gc();
        this.handler_地灵.gc();
        this.handler_精灵.gc();
        this.handler_沙兵.gc();
        this.handler_沙皇.gc();
        this.handler_野猪.gc();
        this.handler_野马.gc();
        this.handler_拳师.gc();
        this.handler_灵阵.gc();
        this.handler_天谕.gc();
        this.handler_妖术.gc();
        this.handler_鼓舞.gc();
        this.smallHandler = null;
        this.bigHandler = null;
        this.handler_幽灵 = null;
        this.handler_恶灵 = null;
        this.handler_炮台 = null;
        this.handler_狙炮 = null;
        this.handler_顽石 = null;
        this.handler_地灵 = null;
        this.handler_精灵 = null;
        this.handler_沙兵 = null;
        this.handler_沙皇 = null;
        this.handler_野猪 = null;
        this.handler_野马 = null;
        this.handler_拳师 = null;
        this.handler_灵阵 = null;
        this.handler_天谕 = null;
        this.handler_妖术 = null;
        this.handler_鼓舞 = null;
    }
    /** 客户端弹出Toast，一般是行动失败 */
    showToast(player, message) {
        player.user.sendObj(GameUtils_1.default.getObj("showToast", { "message": message }));
    }
    /** 行动力消耗 */
    spendAction(player, action) {
        player.small.changeEnergy(-action);
    }
}
exports.HandlerMgr = HandlerMgr;
